package com.wr.service.user;

import com.wr.dao.UserDao;
import com.wr.model.RestResponse;
import com.wr.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author weirong
 * @Title:
 * @Description:
 * @date 2018/6/1114:58
 */
@Service
public class UserServiceImpl implements UserService{

    @Autowired
    private UserDao userDao;
    @Override
    public RestResponse<User> register(User user) {
        return userDao.register(user);
    }

    @Override
    public RestResponse<User> getUserByEmail(String email) {
        return userDao.getUserByEmail(email);
    }

    @Override
    public RestResponse<User> getUserByUserName(String username) {
        return userDao.getUserByUserName(username);
    }

    @Override
    public RestResponse<User> getUserById(Integer id) {
        return userDao.getUserById(id);
    }

    @Override
    public RestResponse<User> authLogin(User user) {
        return userDao.authLogin(user);
    }

    @Override
    public RestResponse<User> getUserByToken(String token) {
        return userDao.getUserByToken(token);
    }

    @Override
    public RestResponse<User> logout(String token) {
        return userDao.logout(token);
    }

    @Override
    public RestResponse<User> resetPw(User user) {
        return userDao.resetPw(user);
    }

    @Override
    public RestResponse<User> update(User user) {
        return userDao.update(user);
    }
}
